//
//      Copyright 2011 Hengda Xiao 224080
//
//      Millionare
//
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//
//      04.05.2011


#ifndef GAMEPLAY_H
#define GAMEPLAY_H


#include "gamesystem.h"
#include "player.h"


class GamePlay
{

public:
    GamePlay(char **argv);
    ~GamePlay();


private:
    GameSystem *questionSys;
    void Menu_Play();//To disdplay the menu on the screen
    void DoChoice_Play();//To judge the choice made by user
    void Menu_Play_Start();//To display the sub menu of start game
    void DoChoice_Play_Start();////To judge the choice made by user of sub menu

    void SelectPlayer();//Corresponding the select player function

    void PrintPrize();//To show which prize level is player in

    void CreatPlayer();//To create a new player
    void DisplayPlayer();//Show the list of all players

    void RunGame();//To start a new round of player
    void PrintRanQuest();//To show the question part of game
    void Judgement();//judge the player's answer os correct or not

    void FiftyFifty();//Corresponding to the fiffty fifty chance function
    void RandomNumber();//To make a random number to server the fifty fifty function
    void PrintRanQuest_FF();//To print the question part when player use FF chance
    void PrintRanQuest_FF_Original();//If the player does not have chance of FF chance,
                                     //To print the original question

    void Instructions();//Corresponding to the instrtuctions
    void Statistics();//Corresponding to the statistics function
    bool checkHighestLevel();//Check if the player reach the highest level

    Player *pHead;
    Player *pCur;
    Player *pNew;

    vector< Question* > random_quest_play;
    vector<int> ffVec;

    int choice;
    int ffAns1;
    int ffAns2;
    int curPrize;
    int curQuest;
    int playNum;
    bool Quit;
    bool quit_SGame;
};

#endif // GAMEPLAY_H
